package com.smu.recognize.Util;

import org.springframework.util.ClassUtils;

import java.text.SimpleDateFormat;
import java.util.Date;

public class CurrentTimeUtil {
    public static String getTime() {
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
        System.out.println(df.format(new Date()));// new Date()为获取当前系统时间

        String relativelyPath=System.getProperty("user.dir");
        System.out.println(relativelyPath);
        return df.format(new Date());
    }
    public static void main(String args[]){
        String relativelyPath=System.getProperty("user.dir");
        String path = ClassUtils.getDefaultClassLoader().getResource("").getPath();
        System.out.println(relativelyPath+"\n"+path);
    }
}
